package cn.itsource.exception;

import cn.itsource.constants.GlobalExceptionCode;
import cn.itsource.utils.AssertUtil;
import lombok.Data;

//全局异常
@Data
public class GlobalException extends RuntimeException{

    private Integer code;
    private String msg;

    public GlobalException(String message){
        super(message);
    }

    public GlobalException(GlobalExceptionCode globalExceptionCode){
        super(globalExceptionCode.getMessage());
        this.code = globalExceptionCode.getCode();
        this.msg = globalExceptionCode.getMessage();
    }
}
